﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Research.Kinect.Nui;
using System.Threading;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

namespace MocKinect.Proxies
{
    public class SkeletonEngineProxy : BaseProxy
    {
        public SkeletonEngineProxy(Runtime mocKinectRuntime)
            : base(mocKinectRuntime)
        {
        }
        public bool IsEnabled { get; set; }
        public TransformSmoothParameters SmoothParameters { get; set; }
        public bool TransformSmooth { get; set; }

        public Vector DepthImageToSkeleton(float depthX, float depthY, short depthValue)
        {
            return new Vector();
        }
        public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY)
        {
            depthX = 0;
            depthY = 0;
                 
        }
        public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY, out short depthValue)
        {
            depthX = 0;
            depthY = 0;
            depthValue = 0;
        }

        internal SkeletonFrame GetNextFrame(int MillisecondsWait)
        {
            SkeletonFrame skeletonFrame = null;
            return skeletonFrame;
        }

        public void Record(SkeletonFrame frame)
        {
            //InitFrameRecorder();

            ////referenceTime = DateTime.Now;
            //writer.Write(RuntimeOptions.UseSkeletalTracking);
            //writer.Write(frame.FloorClipPlane);
            //writer.Write((int)frame.Quality);
            //writer.Write(frame.NormalToGravity);

            //writer.Write(frame.Skeletons.Length);

            //foreach (SkeletonData skeleton in frame.Skeletons)
            //{
            //    writer.Write(skeleton.TrackingID);
            //    writer.Write((int)skeleton.TrackingState);
            //    writer.Write(skeleton.UserIndex);
            //    writer.Write((int)skeleton.Quality);
            //    writer.Write(skeleton.Position);

            //    writer.Write(skeleton.Joints.Count);
            //    foreach (Joint joint in skeleton.Joints)
            //    {
            //        writer.Write((int)joint.ID);
            //        writer.Write((int)joint.TrackingState);
            //        writer.Write(joint.Position);
            //    }
            //}
            //writer.Flush();
        }
    }
}
